package net.easyjava.base.bean.mongodb;

import com.alibaba.fastjson.JSONObject;
import com.google.code.morphia.annotations.Entity;
import net.easyjava.base.utils.baidu.bean.LocationBean;
import net.easyjava.tools.DBean;

import java.util.Date;
import java.util.Map;

/**
 * Created by wenxiaoning on 15/12/20.
 */
@Entity(value = "request_log",noClassnameStored = true)
public class RequestLogBean extends DBean {
    private static final long serialVersionUID = -6459866396741056615L;
    private String fromIP;
    private String fromUrl;
    private String targetUrl;
    private String method;
    private Map location;
    private Map<String,String> params;
    private Map<String,String> heads;
    private int totalTime;//耗时
    private String description;
    private Date createTime;

    public RequestLogBean() {
        this.createTime = new Date();
    }

    public RequestLogBean(String fromIP, String fromUrl, String targetUrl, String method, Map<String, String> params, Map<String, String> heads) {
        this.fromIP = fromIP;
        this.fromUrl = fromUrl;
        this.targetUrl = targetUrl;
        this.method = method;
        this.params = params;
        this.heads = heads;
    }

    public Map getLocation() {
        return location;
    }

    public void setLocation(Map location) {
        this.location = location;
    }

    public int getTotalTime() {
        return totalTime;
    }

    public void setTotalTime(int totalTime) {
        this.totalTime = totalTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getFromIP() {
        return fromIP;
    }

    public void setFromIP(String fromIP) {
        this.fromIP = fromIP;
    }

    public String getFromUrl() {
        return fromUrl;
    }

    public void setFromUrl(String fromUrl) {
        this.fromUrl = fromUrl;
    }

    public String getTargetUrl() {
        return targetUrl;
    }

    public void setTargetUrl(String targetUrl) {
        this.targetUrl = targetUrl;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public Map<String, String> getParams() {
        return params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }

    public Map<String, String> getHeads() {
        return heads;
    }

    public void setHeads(Map<String, String> heads) {
        this.heads = heads;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
